package com.b2b.model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.stereotype.Component;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Data
@Component
@Table(name = "bidding")
public class Bidding implements Serializable {
    private static final long serialVersionUID = 3342723124953988435L;

    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(name = "bidding_id")
    private Integer biddingId;

    @Column(name = "company_id")
    private Integer companyId;

    @Column(name = "stock_id")
    private Integer stockId;

    @Column(name = "starting_price")
    private Integer startingPrice;

    @Column(name = "rate_of_increase")
    private Integer rateOfIncrease;

    private Integer bond;

    @Column(name = "delay_period")
    private Integer delayPeriod;

    @Column(name = "reserve_price")
    private Integer reservePrice;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "bidding_deadline")
    private Date biddingDeadline;

    @Column(name = "current_price")
    private Integer currentPrice;

    private Character state;
}
